import AppComponent from './component/app/app'
import ListComponent from './component/list/list'
import ItemComponent from './component/item/item'
import AboutComponent from './component/about/about'

// const AppComponent = e => import('./component/app/app')
// const AboutComponent = e => import('./component/about/about')

// router.js
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export function createRouter () {
  return new Router({
    mode: 'history',
    routes: [
      // {
      //   path: '/',
      //   name: 'Home',
      //   component: AppComponent
      // },

      {
        path: '/list',
        name: 'List',
        component: ListComponent
      },

      {
        path: '/item/:id',
        name: 'Item',
        component: ItemComponent
      },

      {
        path: '/about',
        name: 'About',
        component: AboutComponent
      }
    ]
  })
}
